package com.example.demo.control;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.servlet.http.HttpSession;

@Configuration
public class WebMVCConfig implements WebMvcConfigurer {
    HttpSession httpSession;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(myInterceptor()).addPathPatterns("/**.html");
    }
    @Bean
    myInterceptor myInterceptor(){
        return new myInterceptor();
    }
}